**# Configuration and Setup
cls 
clear all
set matsize 800 
set more off
set scheme s2mono
graph set window fontface "Times New Roman"
global path_dir "/PATH_PROJECT_FOLDER/" 
cd "${path_dir}/output" 
*log using "results_full_dataset.log", replace

**# Table 1
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"

xtset country_sic_2d_2 year, year
collect: table  ( country2 ) () () if year>=2001, statistic(total indNum_t_priv indNum_t_priv_fd indNum_t_priv_nonfd indNum_crosscountry_priv indNum_withincountry_priv indNum_crossind_priv indNum_withinind_priv)
collect export "table1_deal_distr1.xlsx",replace  
table ( year ) () () if year>=2001, statistic(total indNum_t_priv indNum_t_priv_fd indNum_t_priv_nonfd indNum_crosscountry_priv indNum_withincountry_priv  indNum_crossind_priv indNum_withinind_priv)
collect export "table1_deal_distr2.xlsx",replace  

**# Table 2
gen lscope= l.scope
gen lpercent_publ_toas= l.percent_publ_toas
gen llog_indMean_toas=l.log_indMean_toas
gen llog_num_firms= l.log_num_firms
gen logIndNum_wcountry_priv=log(1 + indNum_withincountry_priv ) 
gen logIndSum_wcountry_priv=log(1 +indSum_withincountry_priv_asset) 
quietly reghdfe logIndNum_t_priv lscope lpercent_publ_toas llog_indMean_toas llog_num_firms, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
quietly estpost summarize ///
		indNum_t_priv	logIndNum* logIndSum*  ///
	  lscope  lpercent_publ_toas ///
	  llog_indMean_toas llog_num_firms ///
	  indMeanRw_roa indSdRw_roa  if e(sample), detail
estout using "stats-2D_1.xls",replace cells("count mean p50 sd")

**# Table 3
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms , absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
esttab
esttab using "Table3.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 4
use "${path_dir}/data-subset/SIC2_panel.dta", clear
xtset sic_country deal_year, yearly
gen country_sample=1 if cntrycde=="AT" | cntrycde=="BE" | cntrycde=="DK" | cntrycde=="DE" | cntrycde=="ES" | cntrycde=="FI" | cntrycde=="FR" | cntrycde=="IT" | cntrycde=="IE" | cntrycde=="NL" | cntrycde=="SE" | cntrycde=="UK" 
drop if cntrycde=="ES" | cntrycde=="UK"
sort sic_country deal_year disclosure
bysort sic_country: gen n=deal_year if disclosure==1 & disclosure[_n-1]==0 & disclosure[_n-1]!=.
bysort sic2 cntrycde: egen treatment=max(n)
replace treatment=0 if cntrycde=="US"
label variable log_private "No. of Targets (log)"
label variable log_privassets "Sum of Targets' Assets (log)"
replace country_sample=1 if cntrycde=="US"
reghdfe log_private disclosure if country_sample==1 & deal_year<2013, abs(sic_country deal_year) cl(country_year)
outreg using "Table4", addrow ("Cluster" "Country-Year"  \ "Country-SIC FE" "Yes" \ "Year FE" "Yes" \ "Sample" "Europe and US") ctitles("" "(1)") bdec(3) starlevels(10 5 1) summstat(r2_a \ N )  starloc(1) coljust(l{.}) summtitle("ADJ. R2" \ "N" ) se var replace
reghdfe log_privassets disclosure if country_sample==1 & deal_year<2013, abs(sic_country deal_year) cl(country_year)
outreg using "Table4", addrow ("Cluster" "Country-Year"  \ "Country-SIC FE" "Yes" \ "Year FE" "Yes" \ "Sample" "Europe and US") ctitles("" "(1)") bdec(3) starlevels(10 5 1) summstat(r2_a \ N )  starloc(1) coljust(l{.}) summtitle("ADJ. R2" \ "N" ) se var replace merge
csdid log_private if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(simple)
outreg using "Table4", addrow ("Cluster" "Country-Year"  \ "Country-SIC FE" "Yes" \ "Year FE" "Yes" \ "Sample" "Europe and US") ctitles("" "(1)") bdec(3) starlevels(10 5 1) summstat(r2_a \ N )  starloc(1) coljust(l{.}) summtitle("ADJ. R2" \ "N" ) se var replace merge
csdid log_privassets if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(simple)
outreg using "Table4", addrow ("Cluster" "Country-Year"  \ "Country-SIC FE" "Yes" \ "Year FE" "Yes" \ "Sample" "Europe and US") ctitles("" "(1)") bdec(3) starlevels(10 5 1) summstat(r2_a \ N )  starloc(1) coljust(l{.}) summtitle("ADJ. R2" \ "N" ) se var replace merge


**# Table 5
use "${path_dir}/data-subset/around_threshold.dta",clear
cd "${path_dir}/output"
eststo: reghdfe dummy_deal fulldisclosure log_toas , absorb(i.country_year i.sic_2d_2) cl( i.country_year) 
eststo: reghdfe dummy_deal fulldisclosure log_toas ,absorb(i.country_year i.country_sic) cl( i.country_year)
eststo: reghdfe dummy_deal fulldisclosure log_toas ,absorb(i.country_year i.bvid2) cl( i.country_year)
esttab
esttab using "Table5.csv",   replace ar2 b(4) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 6
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
keep if country=="Germany"
gen priv_perc=(num_firmspriv)/num_firms
replace priv_perc=. if year>2006
bysort sic_2d: egen priv_limited_share=mean(priv_perc)
gen post=(year>=2007)
xtset country_sic_2d_2 year, year

eststo: reghdfe logIndNum_t_priv c.priv_limited_share#1.post  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa   , absorb( i.year i.sic_2d_2) cl( i.sic_2d_2) noconstant
eststo: reghdfe logIndSum_t_priv c.priv_limited_share#1.post   l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa  , absorb( i.year i.sic_2d_2) cl( i.sic_2d_2) noconstant

esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table6.csv",  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

quiet estpost summarize logIndNum_t_priv logIndSum_t_priv priv_limited_share post  if e(sample), detail
estout using "stats-german_reform.xls",replace cells("count mean p50 sd min max")

**# Table 7 
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
destring sic_2d,replace
gen t_country=""
replace t_country="AT" if country=="Austria"
replace t_country="BE" if country=="Belgium"
replace t_country="DK" if country=="Denmark"
replace t_country="DE" if country=="Germany"
replace t_country="FI" if country=="Finland"
replace t_country="FR" if country=="France"
replace t_country="IE" if country=="Ireland"
replace t_country="IT" if country=="Italy"
replace t_country="NL" if country=="Netherlands"
replace t_country="ES" if country=="Spain"
replace t_country="SE" if country=="Sweden"
replace t_country="UK" if country=="United Kingdom"
joinby sic_2d t_country year using "${path_dir}/data-subset/Patents_all.dta", unm(mas)
tab _m
drop _m
sum applications, d
xtset country_sic_2d_2 year, year
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if applications<=3, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if applications<=3, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if applications>3, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if applications>3, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
esttab 
esttab using "Table7.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 8 
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if redeploy_high==0, absorb(i.country_year i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if redeploy_high==0, absorb(i.country_year i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if redeploy_high==1, absorb(i.country_year i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if redeploy_high==1, absorb(i.country_year i.sic_2d_2) cl( i.country_year) noconstant
esttab , replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01) 
esttab using "Table8.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01) 
eststo clear

**# Table 9 
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
xtile high_size_disp=indSD_toas, n(2)
xtile high_age_disp=indSD_firmage, n(2)

eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_size_disp==1 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_size_disp==1 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_size_disp==2 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_size_disp==2, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 

eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_age_disp==1 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_age_disp==1 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_age_disp==2 , absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if high_age_disp==2, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table9.csv",  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 10 
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
eststo: reghdfe logIndNum_t_priv_fd l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv_fd l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv_nonfd l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv_nonfd l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant
esttab
esttab using "Table10.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 11 
use "${path_dir}/data-subset/Zephyr_with_public_deals.dta",clear
cd "${path_dir}/output"
eststo: reghdfe logIndNum_t_publ l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_publ l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_publ l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if percent_publ<=.0257226, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant
eststo: reghdfe logIndSum_t_publ l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if percent_publ<=.0257226, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant
eststo: reghdfe logIndNum_t_publ l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if percent_publ>.0257226, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant
eststo: reghdfe logIndSum_t_publ  l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if percent_publ>.0257226, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant
esttab ,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table_11.csv",  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 12
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
eststo: reghdfe logIndNum_t_priv l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndNum_t_priv_fd l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv_fd l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndNum_t_priv_nonfd l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv_nonfd l.scope c.l.scope#c.l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
esttab ,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table_12.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
 
**# Table 13
use "${path_dir}/data-subset/around_threshold.dta",clear
eststo: reghdfe dummy_deal fulldisclosure log_toas ,absorb(country_year bvid2) cl(country_year)
eststo: reghdfe dummy_deal fulldisclosure scope log_toas ,absorb(country_year bvid2) cl(country_year)
eststo: reghdfe dummy_deal fulldisclosure log_toas ,absorb(country_year sic_2d_2#year bvid2) cl(country_year)
eststo: reghdfe dummy_deal fulldisclosure scope log_toas ,absorb(country_year sic_2d_2#year bvid2) cl(country_year)
esttab ,   ar2 b(4) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table_13.csv",   replace ar2 b(4) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# Table 14 
use "${path_dir}/data-subset/5_panel data merged-2d_extended.dta", clear
cd "${path_dir}/output"
gen control_after_scope=control_after*l.scope 
gen control_after_disc=control_after*fulldisclosure
gen triple_interaction=control_after*l.scope*fulldisclosure
eststo: reghdfe lnassets control_after if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe lnassets control_after control_after_scope if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe lnassets control_after control_after_disc if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe lnassets control_after control_after_scope control_after_disc triple_interaction if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe leverage control_after if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe leverage control_after control_after_scope if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe leverage control_after control_after_disc if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe leverage control_after control_after_scope control_after_disc triple_interaction if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe roa control_after if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe roa control_after control_after_scope if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe roa control_after control_after_disc if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe roa control_after control_after_scope control_after_disc triple_interaction if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe cash_ratio control_after if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe cash_ratio control_after control_after_scope if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe cash_ratio control_after control_after_disc if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
eststo: reghdfe cash_ratio control_after control_after_scope control_after_disc triple_interaction if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
esttab ,   ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "Table_14.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
quiet reghdfe lnassets control_after  if deal_sample==1 , absorb(i.year i.panel_id) cl(panel_id) noconstant
keep if e(sample)
quiet estpost summarize ///
	lnassets leverage leverage roa cash_ratio  scope fulldisclosure, detail
estout using "stats-2D_panel.xls",replace cells("count mean p50 sd min max")

**# Figure 1
use "${path_dir}/data-subset/Data_availability.dta", clear
cd "${path_dir}/output"
drop if cntrycde=="GB"
label var disc_toas "% with Total assets"
label var disc_opre "% with Sales"
label var disc_ebta "% with EBITDA"
sort cntrycde closdate_year
graph twoway (line disc_toas closdate_year) (line disc_opre closdate_year, lpattern(dash)) (line disc_ebta closdate_year, lpattern(shortdash)lwidth(thick)) , ylabel(0(0.5)1, labsize(small) angle(horizontal)) xlabel(2000(3)2012, labsize(small) angle(vertical))  by(cntrycde, note("")) xtitle("", size(zero)) graphregion(color(white)) bgcolor(white)
graph save Graph_1a.gph,replace
graph export "Graph_1a.pdf", as(pdf) name("Graph")  replace

/* Figure 1B*/
use "${path_dir}/data-subset/Data_availability_all.dta", clear
cd "${path_dir}/output"
label var fd_toas "% with Total assets"
label var fd_sales "% with Sales"
label var fd_ebta "% with EBITDA"
twoway (line fd_toas years_to_adoption) (line fd_sales years_to_adoption, lpattern(dash)) (line fd_ebta years_to_adoption, lpattern(shortdash)lwidth(thick)) if abs(years_to_adoption)<6, xline(0) ylabel(0(0.5)1, labsize(small) angle(horizontal)) xlabel(, labsize(small)) title(Extended Disclosure) name("fd", replace)  xtitle("Years to Disclosure Regulation", size(small)) graphregion(color(white)) bgcolor(white)  
twoway (line nd_toas years_to_adoption) (line nd_sales years_to_adoption, lpattern(dash)) (line nd_ebta years_to_adoption, lpattern(shortdash)lwidth(thick)) if abs(years_to_adoption)<6 , xline(0) ylabel(0(0.5)1, labsize(small) angle(horizontal)) xlabel(, labsize(small)) title(Non Extended Disclosure) name("nd", replace) xtitle("Years to Disclosure Regulation", size(small)) graphregion(color(white)) bgcolor(white)
grc1leg fd nd, col(2) rows(1) saving(fd_nd_all.gph, replace) graphregion(color(white)) legendfrom(fd) 
graph save Graph_1b.gph,replace
graph export "Graph_1b.pdf", as(pdf) name("Graph") replace	
graph drop _all


**#  Figure 2
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
gen cntrycde=country
replace cntrycde="AT" if cntrycde=="Austria"
replace cntrycde="BE" if cntrycde=="Belgium"
replace cntrycde="DK" if cntrycde=="Denmark"
replace cntrycde="DE" if cntrycde=="Germany"
replace cntrycde="FI" if cntrycde=="Finland"
replace cntrycde="FR" if cntrycde=="France"
replace cntrycde="IE" if cntrycde=="Ireland"
replace cntrycde="IT" if cntrycde=="Italy"
replace cntrycde="NL" if cntrycde=="Netherlands"
replace cntrycde="ES" if cntrycde=="Spain"
replace cntrycde="SE" if cntrycde=="Sweden"
replace cntrycde="UK" if cntrycde=="United Kingdom"
keep cntrycde year sic_2d scope indNum_t_priv
destring, replace
bysort year sic_2d: egen sd=sd(scope)
bysort sic_2d: egen a=max(sd)
sum a, d
table sic_2d if a>.07, stat(count scope)
table sic_2d if a>.07, stat(sum indNum_t_priv)
rename year closdate_year
sort cntrycde closdate_year

preserve
keep if sic_2d==50
graph twoway (line scope closdate_year if cntrycde=="DE") (line scope closdate_year if cntrycde=="FR", lpattern(dash)) (line scope closdate_year if cntrycde=="BE", lpattern(shortdash)lwidth(thick)) (line scope closdate_year if cntrycde=="UK", lpattern(longdash)), legend(on order(1 "DE" 2 "FR" 3 "BE" 4 "UK")) ytitle(Mandated Reporting) xtitle(Year) ylabel(0(.1).5) xlabel(2000(3)2012) title(SIC 50 Wholesale trade) name(sic50, replace) graphregion(color(white)) bgcolor(white)
restore
preserve
keep if sic_2d==27
graph twoway (line scope closdate_year if cntrycde=="DE") (line scope closdate_year if cntrycde=="FR", lpattern(dash)) (line scope closdate_year if cntrycde=="BE", lpattern(shortdash)lwidth(thick)) (line scope closdate_year if cntrycde=="UK", lpattern(longdash)), legend(on order(1 "DE" 2 "FR" 3 "BE" 4 "UK")) ytitle(Mandated Reporting) xtitle(Year) ylabel(0(.1).5) xlabel(2000(3)2012) title("SIC 27 Printing, Publishing," "and Allied Industries") name(sic27, replace) graphregion(color(white)) bgcolor(white)
restore
preserve
keep if sic_2d==34
graph twoway (line scope closdate_year if cntrycde=="DE") (line scope closdate_year if cntrycde=="FR", lpattern(dash)) (line scope closdate_year if cntrycde=="BE", lpattern(shortdash) lwidth(thick)) (line scope closdate_year if cntrycde=="UK", lpattern(longdash)), legend(on order(1 "DE" 2 "FR" 3 "BE" 4 "UK")) ytitle(Mandated Reporting) xtitle(Year) ylabel(0(.1).5) xlabel(2000(3)2012) title("SIC 34 Fabricated Metal Products") name(sic34, replace) graphregion(color(white)) bgcolor(white)
restore
preserve
keep if sic_2d==80
graph twoway (line scope closdate_year if cntrycde=="DE") (line scope closdate_year if cntrycde=="FR", lpattern(dash)) (line scope closdate_year if cntrycde=="BE", lpattern(shortdash)lwidth(thick)) (line scope closdate_year if cntrycde=="UK", lpattern(longdash)), legend(on order(1 "DE" 2 "FR" 3 "BE" 4 "UK")) ytitle(Mandated Reporting) xtitle(Year) ylabel(0(.1).5) xlabel(2000(3)2012) title(SIC 80 Health Services) name(sic80, replace) graphregion(color(white)) bgcolor(white)
restore
graph combine  sic50 sic27 sic34 sic80, col(2) row(2)  ycommon graphregion(color(white)) 
*grc1leg sic50 sic27 sic34 sic80, col(2) rows(2) title(Extended disclosure across selected industries) saving(Graph.gph, replace) legendfrom(sic50)
graph export "Graph_2.pdf", as(pdf) name("Graph") replace
graph save Graph_2.gph,replace
**#  Figure 3
use "${path_dir}/data-subset/Zephyr_sic2payment.dta",clear
cd "${path_dir}/output"
xtset sic_country deal_year, yearly
gen country_sample=1 if cntrycde=="AT" | cntrycde=="BE" | cntrycde=="DK" | cntrycde=="DE" | cntrycde=="ES" | cntrycde=="FI" | cntrycde=="FR" | cntrycde=="IT" | cntrycde=="IE" | cntrycde=="NL" | cntrycde=="SE" | cntrycde=="UK" 
replace country_sample=1 if cntrycde=="US"
drop if cntrycde=="ES" | cntrycde=="UK"
sort sic_country deal_year disclosure
bysort sic_country: gen n=deal_year if disclosure==1 & disclosure[_n-1]==0 & disclosure[_n-1]!=.
bysort sic2 cntrycde: egen treatment=max(n)
replace treatment=0 if cntrycde=="US"
/* Dynamics */
gen country=cntrycde
replace country="Austria" if cntrycde=="AT"
replace country="Belgium" if cntrycde== "BE"
replace country="Denmark" if cntrycde=="DK"
replace country="Germany" if cntrycde=="DE"
replace country="Finland" if cntrycde=="FI"
replace country="France" if cntrycde=="FR"
replace country="Ireland" if cntrycde=="IE"
replace country="Italy" if cntrycde=="IT"
replace country="Netherlands" if cntrycde=="NL"
replace country="Spain" if cntrycde=="ES"
replace country="Sweden" if cntrycde=="SE"
replace country="United Kingdom" if cntrycde=="UK"
gen year=deal_year
gen sic_2d=sic2

/* Methods  in proportions */
gen cashpayment_ratio= num_cash / deal_year
gen sharespayment_ratio= num_shares / deal_year
gen cashpayment_assets_ratio= all_cash / all_assets
gen sharespayment_assets_ratio= all_shares / all_assets
sum cashpayment_* sharespayment_*
csdid cashpayment_ratio if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10")   msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title("% No. of targets") name(event_1) xlabel(,angle(0) labsize(vsmall)) ylabel(,angle(0) labsize(vsmall))  graphregion(color(white)) replace
graph export "num_cash2.pdf", as(pdf) name("event_1") replace
csdid cashpayment_assets_ratio if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot,drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10") msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title("% Sum of Targets' Assets") name(event_3) xlabel(,angle(0) labsize(vsmall)) ylabel(,angle(0) labsize(vsmall))  graphregion(color(white)) replace
graph export "num_shares2.pdf", as(pdf) name("event_3") replace
graph save Graph_3.gph, replace
graph combine event_1 event_3 , col(2) rows(1) // saving(Graph_3.gph, replace)  
graph export "Graph_3.pdf", as(pdf) replace
graph drop _all

**# Figure 4
use "${path_dir}/data-subset/Zephyr_sic2value.dta",clear
cd "${path_dir}/output"
csdid log_entvalue if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5","T+5","T+6","T+7","T+8","T+9","T+10") msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) name(Graph_4)  graphregion(color(white)) replace
graph save Graph_4.gph, replace  
graph export "Graph_4.pdf", as(pdf) replace
graph drop _all


**# APPDX 2
*sic-year
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
xtset country_sic_2d_2 year, year
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2##i.year) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2##i.year) cl( i.country_year) noconstant 
esttab ,   ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2a.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
*3d sic
use "${path_dir}/data-subset/1_indLevel data merged-3d_extended.dta",clear
xtset country_sic_3d_2 year, year
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year   i.sic_3d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.sic_3d_2) cl( i.country_year ) noconstant 
esttab ,   ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2b.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
*neg binomial
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
xtset country_sic_2d_2 year, year
eststo: xtnbreg indNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa i.year, fe 
esttab ,   ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2c.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

merge 1:1  country  sic_2d year using "${path_dir}/data-subset/SizeEst_2_scope-2d.dta" 
drop if _merge==2
drop _merge
gen scope_assetw=toas_privfull_est/ toas_priv_est if !missing(scope)
gen scope_asset=toas_privfull/ toas_priv if !missing(scope)
xtset country_sic_2d_2 year, year
reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.sic_2d_2) cl( i.country_year ) noconstant 
gen sample1= e(sample)  //keep the same sample than the main table
eststo: reghdfe logIndNum_t_priv l.scope_assetw l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if sample1==1, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope_assetw l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if sample1==1, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope_asset l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if sample1==1, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant  
eststo: reghdfe logIndSum_t_priv l.scope_asset l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if sample1==1, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2d.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
quiet reghdfe logIndNum_t_priv  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa if sample1==1, absorb(i.country_year i.sic_2d_2) cl( i.country_year) noconstant 
quiet estpost summarize ///
	     scope_assetw scope_asset  if e(sample), detail
estout using "TableAppendix2_stats_a.xls",replace cells("count mean p50 sd min max")

* Robustness with Breuer's Data (NACE 4-digit) 
/* in his data, the variable is also called "scope" */
use "${path_dir}/data-subset/5_Breuer_merged-4d.dta",clear
eststo: reghdfe logIndNum_t_priv mc_scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.nace_4d_2 ) cl( i.country_year ) noconstant
eststo: reghdfe logIndSum_t_priv mc_scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.nace_4d_2 ) cl( i.country_year ) noconstant
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2e.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear
**  Independent Variables: SCOPE
corr scope_us scope mc_scope
quiet estpost summarize ///
	    mc_scope scope_us percent_publ_toas log_indMean_toas log_num_firms indMeanRw_roa indSdRw_roa if e(sample), detail
estout using "TableAppendix2_stats_b.xls",replace cells("count mean p50 sd min max")
eststo clear

*Numerator change
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"

gen scope2= num_firmspriv_fulldisc/num_firmspriv_disc

eststo: reghdfe logIndNum_t_priv c.l.scope2 l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant
eststo: reghdfe logIndSum_t_priv c.l.scope2  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)

use "${path_dir}/data-subset/5_Breuer_merged-4d.dta",clear
eststo: reghdfe logIndNum_t_priv scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.nace_4d_2 ) cl( i.country_year ) noconstant
eststo: reghdfe logIndSum_t_priv scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa , absorb(i.country_year   i.nace_4d_2 ) cl( i.country_year ) noconstant
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix2f.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

	
**# APPDX 3
use "${path_dir}/data-subset/Events.dta", clear
cd "${path_dir}/output"
rename filing_yr year
xtset country_sic_2d_2 year, year
eststo: reghdfe logIndNum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.ipo_shock l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.ipo_shock l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.with_shock l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.with_shock l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.public_ma l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.public_ma l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.ipo_shock l.with_shock l.public_ma l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.ipo_shock l.with_shock l.public_ma l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
esttab,  replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix3.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear


**# APPDX 4
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
joinby country year sic_2d using "${path_dir}/data-subset/ifrs_3_scope-2d.dta",unm(master)  
eststo: reghdfe logIndNum_t_priv l.scope_assets  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope_assets  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope_liab  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope_liab  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope_ebta  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope_ebta  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 

eststo: reghdfe logIndNum_t_priv l.scope_assets l.scope_liab  l.scope_ebta  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv  l.scope_assets l.scope_liab  l.scope_ebta  l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 

esttab , replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix4.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# APPDX 5
use "${path_dir}/data-subset/2_dealLevel data merged-2d_extended.dta", clear
cd "${path_dir}/output"
gen fulldisclosure=t_fulldisclosure==1
local myresults "Full_disc = r(mu_2) Non_full_disc= r(mu_1) Diff = (r(mu_2)-r(mu_1)) pvalue = r(p)"
table (command) (result), command(`myresults': ttest wt_assets, by(fulldisclosure) unequal) /// 
 command(`myresults': ttest wt_leverage, by(fulldisclosure) unequal) ///
 command(`myresults': ttest wt_roa , by(fulldisclosure) unequal) ///
 command(`myresults': ttest log_entvalue, by(fulldisclosure) unequal) ///
 command(`myresults': ttest log_value_ebit, by(fulldisclosure) unequal) ///
 command(`myresults': ttest wa_assets, by(fulldisclosure) unequal) ///
 command(`myresults': ttest wa_leverage, by(fulldisclosure) unequal) ///
 command(`myresults': ttest wa_roa , by(fulldisclosure) unequal) ///
 nformat(%6.3f  Full_disc Non_full_disc Diff)  ///
 nformat(%6.3f  pvalue)
collect clear 

**# APPDX 6
use "${path_dir}/data-subset/2_dealLevel_vert_integration.dta", clear
local deal_level_controls = "pre_t_size wpre_t_lev wpre_t_roa pre_a_size wpre_a_lev wpre_a_roa "
eststo: reghdfe integration c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year)
eststo: reghdfe integration c.fulldisclosure Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year)
eststo: reghdfe integration c.fulldisclosure c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year)
eststo: reghdfe integration c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) 
esttab , replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix6.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear


**# APPDX 7
use "${path_dir}/data-subset/SIC2_panel.dta", clear
cd "${path_dir}/output"
xtset sic_country deal_year, yearly
gen country_sample=1 if cntrycde=="AT" | cntrycde=="BE" | cntrycde=="DK" | cntrycde=="DE" | cntrycde=="ES" | cntrycde=="FI" | cntrycde=="FR" | cntrycde=="IT" | cntrycde=="IE" | cntrycde=="NL" | cntrycde=="SE" | cntrycde=="UK" 
drop if cntrycde=="ES" | cntrycde=="UK"
sort sic_country deal_year disclosure
bysort sic_country: gen n=deal_year if disclosure==1 & disclosure[_n-1]==0 & disclosure[_n-1]!=.
bysort sic2 cntrycde: egen treatment=max(n)
replace treatment=0 if cntrycde=="US"
label variable log_private "No. of Targets (log)"
label variable log_privassets "Sum of Targets' Assets (log)"
replace country_sample=1 if cntrycde=="US"

gen ifrs=0
replace ifrs=1 if cntrycde=="AT" & deal_year>2005
replace ifrs=1 if cntrycde=="BE" & deal_year>2005
replace ifrs=1 if cntrycde=="DK" & deal_year>2005
replace ifrs=1 if cntrycde=="DE" & deal_year>2005
replace ifrs=1 if cntrycde=="ES" & deal_year>2005
replace ifrs=1 if cntrycde=="FI" & deal_year>2005
replace ifrs=1 if cntrycde=="FR" & deal_year>2005
replace ifrs=1 if cntrycde=="IT" & deal_year>2005
replace ifrs=1 if cntrycde=="IE" & deal_year>2005
replace ifrs=1 if cntrycde=="NL" & deal_year>2005
replace ifrs=1 if cntrycde=="SE" & deal_year>2005
replace ifrs=1 if cntrycde=="UK" & deal_year>2005

gen mad=0
replace mad=1 if cntrycde=="AT" & deal_year>2005
replace mad=1 if cntrycde=="BE" & deal_year>2005
replace mad=1 if cntrycde=="DK" & deal_year>2005
replace mad=1 if cntrycde=="DE" & deal_year>2004
replace mad=1 if cntrycde=="ES" & deal_year>2005
replace mad=1 if cntrycde=="FI" & deal_year>2005
replace mad=1 if cntrycde=="FR" & deal_year>2005
replace mad=1 if cntrycde=="IT" & deal_year>2005
replace mad=1 if cntrycde=="IE" & deal_year>2005
replace mad=1 if cntrycde=="NL" & deal_year>2005
replace mad=1 if cntrycde=="SE" & deal_year>2005
replace mad=1 if cntrycde=="UK" & deal_year>2005

gen td=0
replace td=1 if cntrycde=="AT" & deal_year>2007
replace td=1 if cntrycde=="BE" & deal_year>2008
replace td=1 if cntrycde=="DK" & deal_year>2007
replace td=1 if cntrycde=="DE" & deal_year>2007
replace td=1 if cntrycde=="ES" & deal_year>2007
replace td=1 if cntrycde=="FI" & deal_year>2007
replace td=1 if cntrycde=="FR" & deal_year>2007
replace td=1 if cntrycde=="IT" & deal_year>2009
replace td=1 if cntrycde=="IE" & deal_year>2007
replace td=1 if cntrycde=="NL" & deal_year>2009
replace td=1 if cntrycde=="SE" & deal_year>2007
replace td=1 if cntrycde=="UK" & deal_year>2007

eststo: reghdfe log_private disclosure  ifrs mad td if country_sample==1 & deal_year<2013, abs(sic_country ) cl(country_year)
eststo: reghdfe log_privassets disclosure ifrs mad td if country_sample==1 & deal_year<2013, abs(sic_country) cl(country_year)
eststo: reghdfe log_private disclosure ifrs mad td if country_sample==1 & deal_year<2013, abs(sic_country deal_year) cl(country_year)
eststo: reghdfe log_privassets disclosure ifrs mad td if country_sample==1 & deal_year<2013, abs(sic_country deal_year) cl(country_year)
esttab,   replace ar2 b(4) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix7.csv",   replace ar2 b(4) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# APPDX 8
use "${path_dir}/data-subset/1_indLevel data merged-2d_extended.dta",clear
cd "${path_dir}/output"
joinby country year sic_2d using "${path_dir}/data-subset/2_scope-2d_voluntary_merged.dta", unm(master)
eststo: reghdfe logIndNum_t_priv l.scope l.scope_voluntary l.percent_publ_toas l.log_indMean_toas l.log_num_firms, absorb(i.country_year i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndNum_t_priv l.scope l.scope_voluntary l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.scope_voluntary  l.percent_publ_toas l.log_indMean_toas l.log_num_firms , absorb(i.country_year  i.sic_2d_2) cl( i.country_year ) noconstant 
eststo: reghdfe logIndSum_t_priv l.scope l.scope_voluntary l.percent_publ_toas l.log_indMean_toas l.log_num_firms l.indMeanRw_roa l.indSdRw_roa, absorb(i.country_year  i.sic_2d_2) cl( i.country_year) noconstant 
esttab  ,replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
esttab using "TableAppendix8.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# APPDX 9
use "${path_dir}/data-subset/2_dealLevel data merged-2d_extended.dta", clear
cd "${path_dir}/output"	
destring sic_2d,replace
joinby sic_2d t_country year using "${path_dir}/data-subset/Patents_all.dta", unm(mas)
tab _m
drop _m
sum applications, d
local deal_level_controls = "pre_t_size wpre_t_lev wpre_t_roa pre_a_size wpre_a_lev wpre_a_roa "
replace wpre_t_roa=. if wpre_t_roa<=-1 & wpre_t_roa!=.
replace wpre_t_lev=. if wpre_t_lev>1 & wpre_t_lev!=.
replace log_value_ebit=. if dealvalue_ebitda<0 & dealvalue_ebitda!=.
gen fulldisclosure=t_fulldisclosure==1 

eststo: reghdfe log_entvalue c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' if applications<=166, absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_value_ebit c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' if applications<=166, absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_entvalue c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' if applications>166, absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_value_ebit c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' if applications>166, absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
esttab
esttab using "TableAppendix9.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear

**# APPDX 10
cd "${path_dir}/output"
use "${path_dir}/data-subset/2_dealLevel data merged-2d_extended.dta",clear
gen fulldisclosure=t_fulldisclosure==1 
local deal_level_controls = "pre_t_size wpre_t_lev wpre_t_roa pre_a_size wpre_a_lev wpre_a_roa "
replace wpre_t_roa=. if wpre_t_roa<=-1 & wpre_t_roa!=.
replace wpre_t_lev=. if wpre_t_lev>1 & wpre_t_lev!=.
replace log_value_ebit=. if dealvalue_ebitda<0  & dealvalue_ebitda!=.
local deal_level_controls = "pre_t_size wpre_t_lev wpre_t_roa pre_a_size wpre_a_lev wpre_a_roa "
eststo: reghdfe log_entvalue Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls'  , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_entvalue fulldisclosure Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_entvalue c.fulldisclosure c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_entvalue c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant

eststo: reghdfe log_value_ebit Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_value_ebit fulldisclosure Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa  `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_value_ebit c.fulldisclosure c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe log_value_ebit c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant

eststo: reghdfe cash Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe cash fulldisclosure Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe cash c.fulldisclosure c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe cash c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant

eststo: reghdfe shares Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe shares fulldisclosure Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls', absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe shares c.fulldisclosure c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
eststo: reghdfe shares c.fulldisclosure##c.Lscope Lpercent_publ_toas Llog_indMean_toas Llog_num_firms LindMeanRw_roa LindSdRw_roa `deal_level_controls' , absorb(i.country_year i.country_sic_2d_2) cl(country_year) noconstant
esttab using "TableAppendix10.csv", replace ar2 b(3) star(* 0.10 ** 0.05 *** 0.01)
eststo clear 

**# APPDX Fig 1
use "${path_dir}/data-subset/SIC2_panel.dta", clear
xtset sic_country deal_year, yearly
gen country_sample=1 if cntrycde=="AT" | cntrycde=="BE" | cntrycde=="DK" | cntrycde=="DE" | cntrycde=="ES" | cntrycde=="FI" | cntrycde=="FR" | cntrycde=="IT" | cntrycde=="IE" | cntrycde=="NL" | cntrycde=="SE" | cntrycde=="UK" 
replace country_sample=1 if cntrycde=="US"
drop if cntrycde=="ES" | cntrycde=="UK"
sort sic_country deal_year disclosure
bysort sic_country: gen n=deal_year if disclosure==1 & disclosure[_n-1]==0 & disclosure[_n-1]!=.
bysort sic2 cntrycde: egen treatment=max(n)
replace treatment=0 if cntrycde=="US"
label variable log_private "No. of Targets (log)"
label variable log_privassets "Sum of Targets' Assets (log)"
/* Dynamics */
gen country=cntrycde
replace country="Austria" if cntrycde=="AT"
replace country="Belgium" if cntrycde== "BE"
replace country="Denmark" if cntrycde=="DK"
replace country="Germany" if cntrycde=="DE"
replace country="Finland" if cntrycde=="FI"
replace country="France" if cntrycde=="FR"
replace country="Ireland" if cntrycde=="IE"
replace country="Italy" if cntrycde=="IT"
replace country="Netherlands" if cntrycde=="NL"
replace country="Spain" if cntrycde=="ES"
replace country="Sweden" if cntrycde=="SE"
replace country="United Kingdom" if cntrycde=="UK"
gen year=deal_year
gen sic_2d=sic2
/* Figures */
csdid log_crosscountry if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10") msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Cross-Country) name(event_1) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/cross_country.pdf", as(pdf) name("event_1") replace
csdid log_samecountry if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10")  msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Same-Country) name(event_2) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/same_country.pdf", as(pdf) name("event_2") replace
csdid log_contiguous if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10")  msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Contiguous) name(event_3) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/contiguous.pdf", as(pdf) name("event_3") replace
csdid log_colonial if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10")   msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Colonial) name(event_4) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/colonial.pdf", as(pdf) name("event_4") replace
csdid log_language if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10") msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Same Language) name(event_5) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/language.pdf", as(pdf) name("event_5") replace
csdid log_distant if country_sample==1 & deal_year<2013, ivar(sic_country) time(deal_year) gvar(treatment) cl( country_year) agg(event)
coefplot, drop("T-8","T-7","T-6","T-5", "T+8","T+7","T+6","T+5","T+9","T+10")  msymbol(0h) pstyle(p1dot) vertical ytitle(Coefficients) xtitle(Years to Disclosure Regulation) title(Distant) name(event_6) ylabel(,angle(0) labsize(small)) replace graphregion(color(white))
graph export "${path_dir}/output/distant.pdf", as(pdf) name("event_6") replace
graph combine event_2 event_1  event_3  event_6  event_4  event_5, col(2) rows(1)  saving(Graph.gph, replace)  graphregion(color(white))
graph export "${path_dir}/output/Fig_Appdx_1.pdf", as(pdf) replace
graph drop _all


*log close
